//package com.github.prontera.event;
//
//import com.github.prontera.EventHandler;
//import com.github.prontera.config.EventBusinessType;
//import com.github.prontera.domain.EventSubscriber;
//import com.github.prontera.domain.enums.EventStatus;
//import com.github.prontera.service.UserService;
//import com.google.common.base.Objects;
//import com.google.common.base.Preconditions;
//
///**
// * @author Alex
// */
//public class IncreasePointsEventHandler extends EventHandler {
//
//	private final EventHandler successor;
//	private final UserService pointService;
//
//	public IncreasePointsEventHandler(UserService pointService, EventHandler successor) {
//		this.pointService = pointService;
//		this.successor = successor;
//	}
//
//	@Override
//	public void handle(EventSubscriber subscriber) {
//		Preconditions.checkNotNull(subscriber);
//		Preconditions.checkNotNull(subscriber.getId());
//		System.out.println("-----1-----消费----------["+subscriber.getPayload()+"]");
//		if (Objects.equal(EventBusinessType.ADD_PTS, subscriber.getBusinessType())) {
//			
//			System.out.println("-----3-----消费----------["+subscriber.getPayload()+"]");
//			
////			// 这里取巧，将生产者的报文特地写成PointFlow的格式
////			final User request = JsonMapper.nonDefaultMapper().fromJson(subscriber.getPayload(), User.class);
////			// 简单地增加流水，为了简便就没有模拟任何业务上的校验
////			pointService.insert(request);
//			// 增加总数
//			mapper.updateEventStatusByPrimaryKeyInCasMode(subscriber.getId(), EventStatus.NEW, EventStatus.DONE);
//		} else {
//			if (successor != null) {
//				successor.handle(subscriber);
//			}
//		}
//	}
//
//}
